﻿using Model;
using MDFGame;
using System.Collections.Generic;

namespace Hotfix
{
    [ObjectEvent(EventType.ParamStart,999)]
    public class ParamStart:IEvent
    {
        public void Handle(int[] type, params object[] param)
        {
            //int[] temp = new int[1] { (int)UIViewType.Loading };
            Log.Info("游戏正式启动");
            Log.Info("加载全局参数文件");
            GameRoot.DispatcherSystem.Run(EventType.ConfigLoad, null, param);
            Log.Info("加载UI文件包");
            GameRoot.DispatcherSystem.Run(EventType.LoadUIInfo, null, ParamsHelper.GetObj(0));
        }
    }

    [ObjectEvent(EventType.ConfigLoad, 999)]
    public class ConfigLoad : IEvent
    {
        public void Handle(int[]type,params object[] param)
        {
            Dictionary<string, string> _data1 = param[0] as Dictionary<string, string>;
            Dictionary<string, string> _data2 = param[1] as Dictionary<string, string>;
            string _path = param[2] as string;
            GameRoot.GetSystem<ResSystem>().SetConfigData(_data1,_path);
            GameRoot.GetSystem<ResSystem>().SetUIConfigData(_data2, _path);
            GameRoot.GetSystem<ResSystem>().SetCardEffect();

        }
    }
}
